package com.smbms.dao.user;

import com.smbms.pojo.User;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

/**
 * @Description 用户Dao接口
 * @Author 羽落陌殇
 * @Date 2021/7/16 16:26
 * @Version 1.0.0
 */
public interface UserDao {
    // 获取要登录的用户
    public User getLoginUser(Connection connection, String userCode) throws SQLException;
    // 修改当前用户密码
    public int updateUserPassword(Connection connection,int id, String userPassword) throws SQLException;
    // 根据用户名或者角色查询用户总数
    public int getUserCount(Connection connection, String userName, int userRole) throws SQLException;
    // 根据用户名或者角色查询用户列表
    public List<User> getUserList(Connection connection, String userName, int userRole, int currentPageNo, int pageSize) throws SQLException;
    // 根据 userCode 查询用户名是否存在
    public boolean userNameIsExists(Connection connection, String userCode) throws SQLException;
    // 添加用户
    public int createUser(Connection connection, User user) throws SQLException;
    // 根据ID查询用户信息
    public User queryUserById(Connection connection, int id) throws SQLException;
    // 根据ID修改用户信息
    public int updateUser(Connection connection, User user) throws SQLException;
    // 根据ID删除用户信息
    public int deleteUser(Connection connection, int id) throws SQLException;
}
